#include <iostream>
#include <vector>

using namespace std;

int main() {
    int T;
    cin >> T;
    vector<int> results;

    for (int i = 0; i < T; ++i) {
        int N, A, B;
        cin >> N >> A >> B;
        int distance = 10 * (2 * N - 1);
        cout << distance << endl;
    }

    return 0;
}